package com.jldx.common;

import java.util.List;

import com.jfinal.plugin.activerecord.Page;

/**
 * layui 表格返回的结果
 * @author yanjie
 *
 */
public class Result {

	private Integer code = 0;
	private String msg = "";
	private Integer count;
	private List<Object> data;
	
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Integer getCount() {
		return count;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public List<Object> getData() {
		return data;
	}
	public void setData(List<Object> data) {
		this.data = data;
	}
	
	public static Result cast(Page page){
		Result result = new Result();
		result.setCount(page.getTotalRow());
		result.setData(page.getList());
		return result;
	}
	
	
		
}
